Conversation
This switched `codegen` from the `autopep8` formatting to the `black` one, and applies it to `bulk_mad_generator.py` as well. We can enroll more python scripts to it in the future.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces the black formatter as a pre-commit hook and reformats all existing Python code in misc/codegen (and related tests) with black.
- Switch from
autopep8toblackin.pre-commit-config.yaml - Apply
blackformatting to test files and code generator modules undermisc/codegen
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| .pre-commit-config.yaml | Replaced autopep8 hook with black hook |
| misc/codegen/test/test_dbscheme.py | Reformatted with black (line breaks, quoting) |
| misc/codegen/test/test_cppgen.py | Reformatted with black |
| misc/codegen/test/test_cpp.py | Reformatted with black |
| misc/codegen/loaders/*.py | Reformatted with black |
| misc/codegen/lib/*.py | Reformatted with black |
| misc/codegen/generators/*.py | Reformatted with black |
| misc/codegen/codegen.py | Reformatted with black |
Comments suppressed due to low confidence (2)
misc/codegen/test/test_dbscheme.py:18
- [nitpick] Parameter name
typeshadows the built-in; consider renaming it (e.g.,col_type) to avoid confusion.
"type,binding,lhstype,rhstype",
misc/codegen/codegen.py:102
- [nitpick] Remove the trailing comma after the
add_argumentcall to avoid inadvertently creating a tuple expression and improve readability.
),
Also remove the python setup stage as it shouldn't be necessary any more seen that bazel uses a specific bundled one.
esbena
approved these changes
Jun 12, 2025
Contributor
esbena
left a comment
There was a problem hiding this comment.
LGTM assuming the new dependency on black does not require changes to Actions/Local setups/guides.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This switches
codegenfrom theautopep8formatting to theblackone, and applies it tobulk_mad_generator.pyas well. We can enroll more python scripts to it in the future.